package com.iweb.common.utils;

import javax.xml.bind.DatatypeConverter;

public class MD5Util {
    /**
     * 获取该输入流的MD5值
     */
    public static String md5File(String base64) {
        StringBuffer md5 = new StringBuffer();
        byte[] mdBytes = DatatypeConverter.parseBase64Binary(base64);
        // convert the byte to hex format
        for (byte mdByte : mdBytes) {
            md5.append(Integer.toString((mdByte & 0xff) + 0x100, 16).substring(1));
        }
        return md5.toString();
    }
}